package de.zinulla.moviethek;

import android.content.res.Configuration;
import android.os.Bundle;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;

import de.zinulla.moviethek.fragments.ImportExportFragment;

public class ImportExportActivity extends SherlockFragmentActivity {

	long searchId;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// Need to check if Activity has been switched to landscape mode
		// If yes, finished and go back to the start Activity
		if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
			finish();

			return;
		}
// 		Show the new fragment (full screen)
//		DetailFragment details = DetailFragment.newInstance(searchId);
		ImportExportFragment importExport = new ImportExportFragment();
		getSupportFragmentManager().beginTransaction().add(android.R.id.content, importExport).commit();

	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
//		MenuInflater inflater = (MenuInflater) getSupportMenuInflater();
//		inflater.inflate(R.menu.list_menu, menu);
        //Used to put dark icons on light action bar
//	   menu.add("Delete")
//           .setIcon(android.R.drawable.ic_menu_delete)
//           .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);

		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
//		SharedPreferences settings = this.getSharedPreferences(MyMovieConstants.MOVIE_SP, 0);
//		long id = settings.getLong(MyMovieConstants.MOVIE_ID, 0);
//		// Handle item selection
//		if("Delete".equals(item.getTitle())){
//			deleteMovie(id);
//		} else {
//			return super.onOptionsItemSelected(item);
//		}

		return true;
	}
}
